Supercharge Your Power Query Transformations: A Flexible Function for Changing Column Types
Power Query is an incredibly powerful tool for data wrangling, but anyone who has worked with real-world, messy data knows the frustration of a query that breaks because of a simple type conversion error. The built-in Table.TransformColumnTypes function is great, but it can be rigid. What happens if a column is unexpectedly missing? Or if some rows contain text in a column you want to convert to a number? Your entire refresh fails.
To solve this, I've developed a powerful, flexible, and robust custom function in Power Query M called fnTransformColumnTypes. This function not only does everything the standard function does but also gives you complete control over how to handle common data cleaning challenges.
The standard Table.TransformColumnTypes is all-or-nothing. It fails under two very…
( 16
min )